package com.ruoyi.common.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.business.entity.YytMemberReceiveAddress;
import com.ruoyi.common.business.dao.YytMemberReceiveAddressMapper;
import com.ruoyi.common.business.service.YytMemberReceiveAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 会员收货地址表 服务实现类
 * </p>
 *
 * @author huangshun
 * @since 2021-12-16
 */
@Service
public class YytMemberReceiveAddressServiceImpl extends ServiceImpl<YytMemberReceiveAddressMapper, YytMemberReceiveAddress> implements YytMemberReceiveAddressService {

    /**
     * 获取用户默认地址
     */
    @Override
    public YytMemberReceiveAddress getDefaultAddress(String memberId) {
        return getOne(new LambdaQueryWrapper<YytMemberReceiveAddress>().eq(YytMemberReceiveAddress::getMemberId, memberId), false);
    }
}
